﻿using System;
using FlyWebFrame.Model;

namespace FlyWebFrame.Action.admin
{
    public class deletecourse : baseaction
    {
        public override void Treat()
        {
            int Id;
            if (!Int32.TryParse(GetParameter(0), out Id))
            {
                Redirect("/admin/courses");
            }

            Courses c = new Courses();
            c.id = Id;
            c.Delete();
            admin_script += "$('#msg-newsdelete').removeClass('hidden');";
            Redirect("/admin/courses");
        }
    }
}